package com.ncmmall.application.business.goods;

import com.ncmmall.domain.business.goods.comment.GoodsComment;
import com.ncmmall.domain.business.goods.comment.GoodsCommentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author linxs
 * @Description: 商品评论
 * @Date: 2019-07-17 17:08
 */
@Service
@Transactional
public class GoodsCommentApplication {

    @Autowired
    private GoodsCommentRepository commentRepository;

    public void disable(GoodsComment goodsComment) {
        goodsComment.setStatus(1);
        commentRepository.save(goodsComment);
    }

    public void enable(GoodsComment goodsComment) {
        goodsComment.setStatus(2);
        commentRepository.save(goodsComment);
    }
}
